/*
 *  Copyright (c) 2010 Sonrisa Informatikai Kft. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Sonrisa Informatikai Kft. ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Sonrisa.
 *
 * SONRISA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
 * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
 * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SONRISA SHALL NOT BE LIABLE FOR
 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */
package com.zh.jbet.web.components.datatable;

import com.zh.jbet.web.BaseApplication;
import java.util.Date;
import org.apache.wicket.datetime.markup.html.basic.DateLabel;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;

/**
 * Formázott dátum property
 * @author cserepj
 */
public class DatePropertyColumn extends PropertyColumn {

    public DatePropertyColumn(IModel<String> displayModel, String property) {
        super(displayModel, property, property);
    }


    public DatePropertyColumn(IModel<String> displayModel, String sortProperty, String property) {
        super(displayModel, sortProperty, property);
    }

    @Override
    public void populateItem(Item item, String componentId, IModel rowModel) {
        item.add(DateLabel.forShortStyle(componentId, new PropertyModel<Date>(rowModel, getPropertyExpression())));
        //DateLabel.forDatePattern(componentId, createLabelModel(rowModel), BaseApplication.DATE_PATTERN));
    }
}
